<?php

new TestingArrayObject();

class TestingArrayObject {
    
    public $Records;
    public $ArrayObject;
    
    public function __construct() {
        $this->Records = 10;
        $this->ArrayObject = new ArrayObject();
        
        for ($index = 0; $index < 10; $index++) {
            //$this->append(new TestObject($index, $this->createRandomName()));
            $this->ArrayObject->append(new TestObject($index, $this->createRandomName()));
        }
        
        echo "<xmp>";
        print_r($this);
        echo "</xmp>";
        
    }

    private function createRandomName() {

        $chars = "abcdefghijkmnopqrstuvwxyz";
        srand((double) microtime() * 1000000);
        $i = 0;
        $pass = '';

        while ($i <= 7) {
            $num = rand() % 33;
            $tmp = substr($chars, $num, 1);
            $pass = $pass . $tmp;
            $i++;
        }

        return $pass;
    }

}

class TestObject {

    public $id;
    public $name;

    public function __construct($id, $name) {
        $this->id = $id;
        $this->name = $name;
    }

}

?>
